package org.cainiao.jvm.constantpool.field;

/**
 * 注释中【静态常量】和【符号引用】指的字节码文件中的常量池表的条目类型<br />
 * <p>
 * Author: Cai Niao(wdhlzd@163.com)<br />
 */
public class A {

    /**
     * 静态常量（未显式使用，可能被字段表的 ConstantValue 引用）
     * -    #53 = Integer            1
     * <p>
     * <cinit>
     * -    不对 f1 初始化，因为字节码文件的字段表中已经通过 ConstantValue: int 1 携带了初始化值，直接加载到内存即可
     */
    public static final int f1 = 1;
    /**
     * 静态常量（未显式使用，可能被字段表的 ConstantValue 引用）
     * -    #55 = Long               2l
     * <p>
     * <cinit>
     * -    不对 f2 初始化，因为字节码文件的字段表中已经通过 ConstantValue: long 2l 携带了初始化值，直接加载到内存即可
     */
    public static final long f2 = 2;
    /**
     * 符号引用
     * -    #19 = Class              #20            // org/cainiao/jvm/constantpool/field/B
     * -    #21 = Methodref          #19.#3         // org/cainiao/jvm/constantpool/field/B."<init>":()V
     * -    #37 = Fieldref           #8.#38         // org/cainiao/jvm/constantpool/field/A.b1:Lorg/cainiao/jvm/constantpool/field/B;
     * <p>
     * <cinit>
     * -    0: new           #19                 // class org/cainiao/jvm/constantpool/field/B
     * -    3: dup
     * -    4: invokespecial #21                 // Method org/cainiao/jvm/constantpool/field/B."<init>":()V
     * -    7: putstatic     #37                 // Field b1:Lorg/cainiao/jvm/constantpool/field/B;
     */
    public static final B b1 = new B();

    /**
     * 符号引用
     * -    #40 = Fieldref           #8.#41         // org/cainiao/jvm/constantpool/field/A.f3:I
     * <p>
     * <cinit>
     * -    10: iconst_3
     * -    11: putstatic     #40                 // Field f3:I
     */
    public static int f3 = 3;
    /**
     * 静态常量：
     * -    #43 = Long               4l
     * 符号引用
     * -    #45 = Fieldref           #8.#46         // org/cainiao/jvm/constantpool/field/A.f4:J
     * <p>
     * <cinit>
     * -    14: ldc2_w        #43                 // long 4l
     * -    17: putstatic     #45                 // Field f4:J
     */
    public static long f4 = 4;
    /**
     * 符号引用
     * -    #19 = Class              #20            // org/cainiao/jvm/constantpool/field/B
     * -    #21 = Methodref          #19.#3         // org/cainiao/jvm/constantpool/field/B."<init>":()V
     * -    #48 = Fieldref           #8.#49         // org/cainiao/jvm/constantpool/field/A.b2:Lorg/cainiao/jvm/constantpool/field/B;
     * <p>
     * <cinit>
     * -    20: new           #19                 // class org/cainiao/jvm/constantpool/field/B
     * -    23: dup
     * -    24: invokespecial #21                 // Method org/cainiao/jvm/constantpool/field/B."<init>":()V
     * -    27: putstatic     #48                 // Field b2:Lorg/cainiao/jvm/constantpool/field/B;
     */
    public static B b2 = new B();

    /**
     * 静态常量（未显式使用，可能被字段表的 ConstantValue 引用）：
     * -    #57 = Integer            5
     * 符号引用
     * -    #7 = Fieldref           #8.#9          // org/cainiao/jvm/constantpool/field/A.f5:I
     * <p>
     * 无参构造器 A()
     * -    5: iconst_5
     * -    6: putfield      #7                  // Field f5:I
     */
    public final int f5 = 5;
    /**
     * 静态常量
     * -    #13 = Long               6l
     * 符号引用
     * -    #15 = Fieldref           #8.#16         // org/cainiao/jvm/constantpool/field/A.f6:J
     * <p>
     * 无参构造器 A()
     * -    10: ldc2_w        #13                 // long 6l
     * -    13: putfield      #15                 // Field f6:J
     */
    public final long f6 = 6;
    /**
     * 符号引用
     * -    #19 = Class              #20            // org/cainiao/jvm/constantpool/field/B
     * -    #21 = Methodref          #19.#3         // org/cainiao/jvm/constantpool/field/B."<init>":()V
     * -    #22 = Fieldref           #8.#23         // org/cainiao/jvm/constantpool/field/A.b3:Lorg/cainiao/jvm/constantpool/field/B;
     * <p>
     * 无参构造器 A()
     * -    17: new           #19                 // class org/cainiao/jvm/constantpool/field/B
     * -    20: dup
     * -    21: invokespecial #21                 // Method org/cainiao/jvm/constantpool/field/B."<init>":()V
     * -    24: putfield      #22                 // Field b3:Lorg/cainiao/jvm/constantpool/field/B;
     */
    public final B b3 = new B();

    /**
     * 符号引用
     * -    #26 = Fieldref           #8.#27         // org/cainiao/jvm/constantpool/field/A.f7:I
     * <p>
     * 无参构造器 A()
     * -    28: bipush        7
     * -    30: putfield      #26                 // Field f7:I
     */
    public int f7 = 7;
    /**
     * 静态常量
     * -    #29 = Long               8l
     * 符号引用
     * -    #31 = Fieldref           #8.#32         // org/cainiao/jvm/constantpool/field/A.f8:J
     * <p>
     * 无参构造器 A()
     * -    34: ldc2_w        #29                 // long 8l
     * -    37: putfield      #31                 // Field f8:J
     */
    public long f8 = 8;
    /**
     * 符号引用
     * -    #19 = Class              #20            // org/cainiao/jvm/constantpool/field/B
     * -    #21 = Methodref          #19.#3         // org/cainiao/jvm/constantpool/field/B."<init>":()V
     * -    #34 = Fieldref           #8.#35         // org/cainiao/jvm/constantpool/field/A.b4:Lorg/cainiao/jvm/constantpool/field/B;
     * <p>
     * 无参构造器 A()
     * -    41: new           #19                 // class org/cainiao/jvm/constantpool/field/B
     * -    44: dup
     * -    45: invokespecial #21                 // Method org/cainiao/jvm/constantpool/field/B."<init>":()V
     * -    48: putfield      #34                 // Field b4:Lorg/cainiao/jvm/constantpool/field/B;
     */
    public B b4 = new B();
}
